package com.bigdata.spark.core.rdd.operator.transform

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

/**
 * @author : ranzlupup
 * @date : 2023/2/28 19:15
 */
object Memory_RDD {
    def main(args: Array[String]): Unit = {

        val sparkConf: SparkConf = new SparkConf().setMaster("local[*]").setAppName("spark")
        val sparkContext: SparkContext = new SparkContext(sparkConf)

        val rdd1: RDD[Int] = sparkContext.parallelize(List(1, 2, 3, 4))
        val rdd2: RDD[Int] = sparkContext.makeRDD(List(1, 2, 3, 4))

        rdd1.collect().foreach(println)
        rdd2.collect().foreach(println)

        sparkContext.stop()
    }

}
